<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>伸缩导航</title>
<style>
.box {
    width: 200px;
    height: auto;
    user-select: none; /*文本不能被选择*/
    -webkit-user-select: none;
}
label {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%; /*0%~50%*/
    background: #666;
    font-size: 30px;
    line-height: 30px; /*文字垂直居中图片有效*/
    text-align: center; /*文字水平居中 图片有效 对加号操作*/
    color: #fff;
    cursor: pointer;
    transform: rotate(360deg); /*添加CSS3动画效果（实际为过渡效果）*/
    transition: all 0.5s linear;
}
.nav {
    margin-top: 15px;
}
.nav a {
    display: block;
    width: 150px;
    height: 30px;
    background: #123;
    font-size: 14px;
    color: #fff;
    text-decoration: none; /*去掉A标签的下划线*/
    line-height: 30px;
    text-indent: 15px; /*默认值 隐藏掉A标签*/
    margin-left: -130px; /*添加CSS3动画效果*/
    transition: margin-left 0.5s linear;
}
#checkbox:checked+label {
    transform: rotate(0deg);
}
#checkbox:checked~.nav a {
    margin-left: 0px; /*选中后a的左边距为0*/
}
#checkbox:checked~.nav a:hover {
    background: #456;
}
.nav a:nth-child(1) {
    transition-delay: 0ms;
    border-right: 5px solid #f02452;
}
.nav a:nth-child(2) {
    transition-delay: 100ms;
    border-right: 5px solid #1da037;
}
.nav a:nth-child(3) {
    transition-delay: 200ms;
    border-right: 5px solid #a86d33;
}
.nav a:nth-child(4) {
    transition-delay: 300ms;
    border-right: 5px solid #b834a4;
}
.nav a:nth-child(5) {
    transition-delay: 400ms;
    border-right: 5px solid #594372;
}
.all {
    width: 200px;
    height: auto;
    user-select: none;
    -webkit-user-select: none;
}
.nav1 {
    margin-top: 15px;
}
.nav1 a {
    display: block;
    width: 200px;
    height: 50px;
    font-size: 18px;
    font-weight: 600;
    color: #000;
    text-decoration: none;
    margin-top: 5px;
    line-height: 50px;
    border-radius: 5px;
    text-indent: 20px;
    margin-left: -180px;
    box-shadow: 1px 1px 2px #6a6a6a;
    transition: margin-left 0.5s linear;
}
.nav1 a:hover {
    margin-left: 0px;
}
.nav1 a:nth-child(1) {
    background: #771cae;
}
.nav1 a:nth-child(2) {
    background: #343998;
}
.nav1 a:nth-child(3) {
    background: #ab3112;
}
.nav1 a:nth-child(4) {
    background: #124f6b;
}
.nav1 a:nth-child(5) {
    background: #0b4b05;
}
.nav1 a:nth-child(6) {
    background: #709207;
}
</style>
</head>
<body>
<div class="box">
    <input type="checkbox" id="checkbox" hidden />
    <label for="checkbox">+</label>
    <div class="nav">
        <a href="javascript:void(0)">首页</a>
        <a href="javascript:void(0)">关于我们</a>
        <a href="javascript:void(0)">产品展示</a>
        <a href="javascript:void(0)">新闻动态</a>
        <a href="javascript:void(0)">联系我们</a>
    </div>
</div>
<div class="all">
    <div class="nav1">
        <a href="javascript:void(0)">首页</a>
        <a href="javascript:void(0)">关于我们</a>
        <a href="javascript:void(0)">产品展示</a>
        <a href="javascript:void(0)">新闻动态</a>
        <a href="javascript:void(0)">联系我们</a>
        <a href="javascript:void(0)">公司地址</a>
    </div>
</div>
</body>
</html>